﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Gpsys.Web.Business
{
    /// <summary>
    /// CommonBusiness
    /// </summary>
    public class CommonBusiness : BaseBusiness
    {
        /// <summary>
        /// Tests the connection to database.
        /// </summary>
        /// <returns></returns>
        public bool TestConnectionToDatabase()
        {
            try
            {
                SQL.OpenConnection();

                var date = SQL.Query<DateTime>("select getdate() ");

                return true;
            }
            catch
            {
                return false;
            }
            finally
            {
                SQL.CloseConnection();
            }
        }
    }
}
